package com.wyp.design.pattern.creational.simplefactory;


/**
 * @author: yipeng.wang01@hand-china.com-25490
 * @TIME: 2019/12/26/15:50
 **/
public class Test {
//    public static void main(String[] args) {
//        VideoFactory factory = new VideoFactory();
//        Video video = factory.createVideo("java");
//        video.produce();
//    }

    //使用反射，，尽量避免修改Factory类，开闭原则

    public static void main(String[] args) {
        VideoFactory factory = new VideoFactory();
        Video video = factory.createVideo(JavaVideo.class);
        video.produce();
    }
}
